package com.youlu.campus.entity;
import com.youlu.campus.base.base.EntityBase;
import com.youlu.campus.entity.enums.CaMaterialType;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * 用户证书领取记录
 */
@Getter
@Setter
@Document(collection = "user_ca_receive_record")
@CompoundIndexes({
        @CompoundIndex(name = "receive_ca_comIdx",def = "{'userId':1,'userCaId':1,'activityId':1,'material':1,'caType':1," +
                "'caLevel':1}",unique = true)
})
public class UserCaReceiveRecord extends EntityBase {

    @Indexed
    private String activityId;

    @Indexed
    private String userCaId;
    @Indexed
    private String userId;
    /**
     * 材质
     */
    @Indexed
    private CaMaterialType material;
    @Indexed
    private String caType;
    @Indexed
    private String caLevel;
    /**
     * 备注
     */
    private String comments;
    /**
     * 领取时间
     */
    private Date receiveTime;
    /**
     * 货币类型,1:数字人民币,2:人民币,3:积分,4:会员权益,5:以物换物,6:免费
     */
    private String moneyType = "2";
    /**
     * 价格
     */
    private Integer price;

    /**
     * 是否领取
     */
    private Boolean received = Boolean.FALSE;
}
